//
//  ViewController.m
//  Animation
//
//  Created by dengbb on 16/2/29.
//  Copyright © 2016年 mohekeji. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@property(nonatomic,strong)UILabel *re;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _re = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, 100, 100)];
    _re.backgroundColor = UIColor.blackColor;
    [self.view addSubview:_re];
    [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(startAnimation) userInfo:nil repeats:YES];
    [self useDate];
}

-(void)startAnimation{
    [UIView animateWithDuration:1 animations:^{
        _re.frame = CGRectMake(100, 200, 30, 30);
        _re.backgroundColor = UIColor.greenColor;
    } completion:^(BOOL finished) {
//        _re.hidden = YES;
    }];
}

-(void)useDate{
    
    NSDate *d = [NSDate dateWithTimeIntervalSince1970:100000];
    NSDateFormatter *f = [[NSDateFormatter alloc] init];
    [f setDateFormat:@"yyyy-MM-dd"];
    NSLog(@"%@",[f stringFromDate:d]);
    // 时间戳
    NSTimeInterval ti = [[NSDate date] timeIntervalSinceDate:d];
    NSLog(@"%f",ti);
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
